<?php
/**
 * 指定请求方式 通过行为的verb行为类
 */
namespace app\controllers;

use yii\filters\VerbFilter;
use yii\web\Controller;
use yii\web\Response;

class VerbController extends Controller
{
    public function behaviors()
    {
        return [
            //指定action 接收的HTTP请求方式
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post', 'delete'], // 也可以接受 DELETE
                ],
            ],
        ];
    }

    public function actionDelete()
    {
        return "hello world!";
    }
}